<?php
$jssdk = new JSSDK("wx5d13ad141dbb55f5", "ea9efd4b26b769092bb842a1d06a4f1c");
$signPackage = $jssdk->GetSignPackage();	

function curPageURL() 
{
    $pageURL = 'http';

    if ($_SERVER["HTTPS"] == "on") 
    {
        $pageURL .= "s";
    }
    $pageURL .= "://";

    $this_page = $_SERVER["REQUEST_URI"];
    
    // 只取 ? 前面的内容
    if (strpos($this_page, "?") !== false) 
        $this_page = reset(explode("?", $this_page));

    if ($_SERVER["SERVER_PORT"] != "80") 
    {
        $pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $this_page;
    } 
    else 
    {
        $pageURL .= $_SERVER["SERVER_NAME"] . $this_page;
    }
    return $pageURL;
}
?>

